Skip to content

fix(ci): unblock builds with solana-signature 3.4.1 and anchor 1.0.2#606

Merged
dev-jodee merged 1 commit into
mainfrom
fix/ci-five8-anchor
Jun 24, 2026
Merged

fix(ci): unblock builds with solana-signature 3.4.1 and anchor 1.0.2#606
dev-jodee merged 1 commit into
mainfrom
fix/ci-five8-anchor

Conversation

@dev-jodee

Copy link
Copy Markdown
Collaborator

Why CI on main is red

Two independent upstream-driven breakages, both from major releases pulled by loose version pins.

1. Native / ASM / Pinocchio — five8 1.0.0 breaks solana-signature 3.3.0

cargo test (host build) fails to compile:

error[E0277]: the trait bound `DecodeError: std::error::Error` is not satisfied
  five8::decode_64(s, &mut buf).map_err(SignatureError::from_source)?;
  • solana-signature 3.3.0 enters via the litesvm dev-dependency and declares five8 = "1.0.0".
  • five8 1.0.0 is #![no_std] and dropped the Error impl on DecodeError that 3.3.0's from_source requires → broken release.
  • The committed Cargo.lock pinned solana-signature 3.3.0, so CI stayed on the broken combo.

Fix: pin the lockfile to solana-signature 3.4.1 (fixes the usage; still uses five8 1.0.0). Compile-verified locally — the full litesvm/solana-svm stack builds and the DecodeError error is gone.

2. Anchor — CLI / lib version mismatch

Error: anchor-cli 1.0.0 (resolved from anchor-lang dep ...) is not installed.
  • Programs were split across anchor-lang 1.0.0-rc.5 (35 files) and 1.0.0 (15 files) after the rc migration + a dependabot bump.
  • The workflow still installed anchor-cli 0.32.1, so anchor build's exact CLI/lib match failed for every project.

Fix: standardize all 50 programs (anchor-lang + anchor-spl) and anchor.yml on anchor 1.0.2 (latest stable); drop the now-stale "pin to RC" comments. Lock resolves cleanly to anchor 1.0.2 with no conflicts; manifests TOML-validated. anchor build itself will be confirmed by CI here.

Changes

  • Cargo.lock: solana-signature 3.3.0 → 3.4.1, anchor-lang/anchor-* 1.0.0 → 1.0.2
  • 50 anchor Cargo.toml: anchor-lang/anchor-spl1.0.2
  • .github/workflows/anchor.yml: anchor-version 0.32.1 → 1.0.2

@greptile-apps

greptile-apps Bot commented Jun 23, 2026

Copy link
Copy Markdown

Greptile Summary

This PR unblocks two independent CI breakages: it bumps solana-signature from 3.3.0 to 3.4.1 in Cargo.lock (resolving the five8 1.0.0 / DecodeError incompatibility), and standardizes all 50 Anchor programs on anchor-lang/anchor-spl 1.0.2 with the matching CLI version in the workflow.

  • Cargo fixes: root Cargo.lock pins solana-signature 3.4.1 and all anchor-* packages to 1.0.2; the two sub-workspace lock files (nft-operations, token-fundraiser) are regenerated to match the new anchor-lang 1.0.2 requirement.
  • Workflow improvements: anchor.yml adds a 3-attempt retry loop for anchor build, introduces anchor build --ignore-keys + anchor keys sync to handle ephemeral keypairs in CI, and switches to anchor test --validator legacy; all four CI workflows gain CARGO_NET_RETRY and sparse-registry hardening.
  • Supporting fixes: asm package.json files add pnpm.ignoredBuiltDependencies to suppress ERR_PNPM_IGNORED_BUILDS, pnpm is pinned to 10.33.0 in solana-asm.yml, and basics/favorites/native is skipped in .ghaignore for a known bankrun toolchain incompatibility.

Confidence Score: 5/5

Safe to merge — the changes are purely version pins and workflow fixes that unblock a broken main branch with no functional logic changes.

All changes are mechanical version bumps (solana-signature 3.4.1, anchor 1.0.2) and CI workflow hardening. The Cargo.lock changes are consistent with the declared Cargo.toml versions, both sub-workspace lock files were regenerated, and the workflow logic is straightforward retry/flag plumbing. No application logic is altered.

No files require special attention beyond the already-noted anchor.yml retry loop cosmetics.

Important Files Changed

Filename Overview
.github/workflows/anchor.yml Upgrades anchor-cli to 1.0.2, adds retry loop for anchor build with --ignore-keys, anchor keys sync without error check, and --validator legacy for tests; retry loop emits a misleading "retrying" message on the final failed attempt
Cargo.lock Root lock file bumps solana-signature 3.3.0→3.4.1 and all anchor-* crates to 1.0.2, resolving the five8/DecodeError build failure
.github/workflows/solana-asm.yml Adds CARGO_NET_RETRY/sparse-registry env vars, pins pnpm to 10.33.0, and adds Cargo.lock/Cargo.toml to dorny path filters
.github/workflows/solana-native.yml Adds CARGO_NET_RETRY/sparse-registry env vars and Cargo.lock/Cargo.toml to dorny path filters for the native workflow
.github/workflows/solana-pinocchio.yml Adds CARGO_NET_RETRY/sparse-registry env vars and Cargo.lock/Cargo.toml to dorny path filters for the pinocchio workflow
tokens/nft-operations/anchor/Cargo.lock Sub-workspace lock file regenerated from anchor-lang 1.0.0-rc.5 to 1.0.2, now consistent with the Cargo.toml declaration
tokens/token-fundraiser/anchor/Cargo.lock Sub-workspace lock file regenerated from anchor-lang 1.0.0-rc.5 to 1.0.2, now consistent with the Cargo.toml declaration
basics/cross-program-invocation/anchor/programs/hand/src/lib.rs Updates declare_id! to match the newly committed ephemeral keypair for the hand program
.github/.ghaignore Adds basics/favorites/native to CI ignore list for a known bankrun/build-sbf toolchain incompatibility

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[CI Trigger] --> B{anchor.yml}
    B --> C[pnpm install --frozen-lockfile]
    C --> D{anchor build --ignore-keys\nattempt 1..3}
    D -->|success| E[anchor keys sync]
    D -->|all 3 fail| F[❌ build failed\nlog + exit 1]
    E --> G[anchor test --validator legacy]
    G -->|pass| H[✅ cleanup target/ node_modules/]
    G -->|fail| I[❌ test failed\nlog + exit 1]

    subgraph Cargo fix
        J[solana-signature 3.3.0] -->|five8 1.0.0 breaks DecodeError| K[❌ compile error]
        L[solana-signature 3.4.1] -->|fixes Error impl| M[✅ compiles]
    end

    subgraph Anchor fix
        N[anchor-lang mixed\n1.0.0-rc.5 + 1.0.0] -->|CLI/lib mismatch| O[❌ anchor build fails]
        P[anchor-lang 1.0.2\nuniform across 50 programs] --> Q[✅ CLI matches lib]
    end
Loading
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
flowchart TD
    A[CI Trigger] --> B{anchor.yml}
    B --> C[pnpm install --frozen-lockfile]
    C --> D{anchor build --ignore-keys\nattempt 1..3}
    D -->|success| E[anchor keys sync]
    D -->|all 3 fail| F[❌ build failed\nlog + exit 1]
    E --> G[anchor test --validator legacy]
    G -->|pass| H[✅ cleanup target/ node_modules/]
    G -->|fail| I[❌ test failed\nlog + exit 1]

    subgraph Cargo fix
        J[solana-signature 3.3.0] -->|five8 1.0.0 breaks DecodeError| K[❌ compile error]
        L[solana-signature 3.4.1] -->|fixes Error impl| M[✅ compiles]
    end

    subgraph Anchor fix
        N[anchor-lang mixed\n1.0.0-rc.5 + 1.0.0] -->|CLI/lib mismatch| O[❌ anchor build fails]
        P[anchor-lang 1.0.2\nuniform across 50 programs] --> Q[✅ CLI matches lib]
    end
Loading

Reviews (14): Last reviewed commit: "fix(ci): repair main CI (five8/wincode, ..." | Re-trigger Greptile

Comment thread tokens/nft-operations/anchor/programs/mint-nft/Cargo.toml
Comment thread .github/workflows/anchor.yml Outdated
Comment thread basics/cross-program-invocation/anchor/target/deploy/hand-keypair.json Outdated
Main was red across the Native, ASM, Pinocchio and Anchor workflows.

Native/Pinocchio/ASM dependency builds:
- solana-signature 3.3.0 (via the litesvm dev-dependency) pulled five8 1.0.0,
  which is no_std and dropped DecodeError's Error impl, so host test builds
  failed to compile. Pin the lockfile to solana-signature 3.4.1.
- 3.4.1 moved wincode to 0.5.x while solana-hash 4.2.0, solana-message 4.0.0
  and solana-transaction 4.0.0 stayed on 0.4.x, splitting the graph across
  two wincode versions. Bump those three (4.4.0 / 4.1.0 / 4.1.0) so the graph
  resolves a single wincode 0.5.3.

Anchor:
- Programs were split across anchor-lang 1.0.0-rc.5 and 1.0.0 while the
  workflow installed anchor-cli 0.32.1. Standardize all programs and the
  workflow on anchor 1.0.2, and sync the two committed sub-workspace locks.
- Build with --ignore-keys and run anchor keys sync for the ephemeral
  keypairs CI generates; run anchor test with --validator legacy since
  surfpool (the Anchor 1.0 default) is not installed.
- cross-program-invocation: declare_program!(lever) bakes lever's IDL address
  into hand at build time, so ephemeral keys broke the CPI owner check.
  Commit stable hand/lever keypairs and align declare_id!, Anchor.toml and
  idls/lever.json.

ASM:
- Pin pnpm to 10.33.0 (unpinned latest fails CI with ERR_PNPM_IGNORED_BUILDS)
  and mark bufferutil/utf-8-validate as ignoredBuiltDependencies.

CI hardening:
- Force the sparse registry protocol, raise CARGO_NET_RETRY and retry anchor
  build to ride out transient crates.io index fetch failures.
- Trigger the native/pinocchio/asm workflows on root Cargo.lock/Cargo.toml
  changes so dependency bumps actually exercise them (this gap is why the
  dependabot solana-* bumps broke main without being caught).

Ignore basics/favorites/native: pre-existing failure where bankrun's runtime
rejects an instruction the current build-sbf toolchain emits; tracked for a
bankrun -> litesvm test migration.
@dev-jodee dev-jodee force-pushed the fix/ci-five8-anchor branch from 1e24ef4 to 17cb3ff Compare June 24, 2026 13:51
@dev-jodee dev-jodee requested a review from amilz June 24, 2026 13:53
@dev-jodee dev-jodee merged commit 2401136 into main Jun 24, 2026
32 checks passed
dev-jodee added a commit that referenced this pull request Jun 24, 2026
* chore(ci): drop redundant pnpm config from asm projects

The pnpm 10.33.0 pin in the asm workflow is what fixes the
ERR_PNPM_IGNORED_BUILDS failure (pinned pnpm treats ignored build scripts as
a warning, not a hard error). The per-project pnpm.ignoredBuiltDependencies
blocks only silenced the warning and did not fix CI, so remove them.

* ci(anchor): drop anchor build retry loop

The sparse registry protocol (CARGO_REGISTRIES_CRATES_IO_PROTOCOL) plus
CARGO_NET_RETRY handle the transient crates.io index fetch failures at the
cargo level, so the explicit 3x anchor build retry loop is redundant.

* ci(anchor): drop redundant explicit anchor keys sync

anchor test syncs program ids to the ephemeral keypair itself before
building and deploying, so the separate anchor keys sync step is redundant.

* refactor(anchor): stage cpi keypairs via pre_build hook

The cross-program-invocation example needs stable hand/lever program ids
(declare_program! bakes the lever address into hand). They were force-added
into the gitignored target/deploy. Move them to a tracked keypairs/ dir and
stage them into target/deploy with an Anchor.toml pre_build hook, so the
ids stay stable without committing into an ignored path.

* ci(anchor): verify cpi keypairs match Anchor.toml in pre_build

The global anchor build --ignore-keys skips the keypair/declare_id check, so
a drifted or missing committed keypair would only surface at test time. Have
the pre_build hook assert each staged keypair's pubkey appears in Anchor.toml
and fail the build loudly otherwise.

* docs(ci): note anchor 1.0.x key-sync assumption in anchor test

The reliance on anchor test syncing program ids itself is Anchor 1.0.x
behavior; flag it so it gets re-verified when anchor-version is bumped.

---------

Co-authored-by: Jo D <dev-jodee@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants